home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / network / ka9q / ka9q_src.arc / NRS.H < prev    next >
C/C++ Source or Header  |  1988-07-28  |  1KB  |  33 lines

  1. /* cat > ./nrs.h << '\Rogue\Monster\' */
  2. /* SLIP definitions */
  3. #define    NRS_ALLOC    40    /* Receiver allocation increment */
  4.  
  5. #define STX    0x02        /* frame start */
  6. #define ETX 0x03        /* frame end */
  7. #define DLE    0x10        /* data link escape */
  8. #define NUL 0x0            /* null character */
  9.  
  10. /* packet unstuffing state machine */
  11. #define NRS_INTER    0        /* in between packets */
  12. #define NRS_INPACK    1        /* we've seen STX, and are in a the packet */
  13. #define NRS_ESCAPE    2        /* we've seen a DLE while in NRS_INPACK */
  14. #define NRS_CSUM    3        /* we've seen an ETX, and are waiting for the checksum */
  15.  
  16. /* net/rom serial protocol control structure */
  17. struct nrs {
  18.     struct mbuf *sndq;    /* Encapsulated packets awaiting transmission */
  19.     int16 sndcnt;        /* Number of datagrams on queue */
  20.     char state;            /* Receiver State control flag */
  21.     unsigned char csum;    /* Accumulating checksum */
  22.     struct mbuf *rbp;    /* Head of mbuf chain being filled */
  23.     struct mbuf *rbp1;    /* Pointer to mbuf currently being written */
  24.     char *rcp;            /* Write pointer */
  25.     int16 rcnt;            /* Length of mbuf chain */
  26.     struct mbuf *tbp;    /* Transmit mbuf being sent */
  27.     long errors;        /* Checksum errors detected */
  28.     long packets ;        /* Number of packets received successfully */
  29.     struct interface *iface ;    /* Associated interface structure */
  30. };
  31.  
  32. extern struct nrs nrs[];
  33.